#!/bin/sh -ex

mkdir -p /var/trash
for file in \
    /etc/nsswitch.conf \
    /usr/lib/netdata/conf.d/python.d.conf \
    /lib/systemd/system/smartmontools.service
do
    dpkg-divert --add --package truenas-files --rename --divert "/var/trash/$(echo "$file" | sed "s/\//_/g")" "$file"
done
